package com.fengmi.mapper;

import com.fengmi.entity.MallGoodsBrandEntity;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 存储库：品牌表
 *
 * @author
 * @date 2022-01-19 20:01:16
 */
@Repository
public interface MallGoodsBrandmapper {
    //查询所有品牌信息
    List<MallGoodsBrandEntity> selectAll(MallGoodsBrandEntity mallGoodsBrandEntity);

    //添加品牌
    @Insert("insert into mall_goods_brand (name,first_letter,sort,show_status,logo) " +
            "values (#{name},#{firstLetter},#{sort},#{showStatus},#{logo})")
    public int insertBrand(MallGoodsBrandEntity mallGoodsBrand);

    //查询某一个品牌
    @Select("select * from mall_goods_brand where id = #{id}")
    public MallGoodsBrandEntity getOneBrandById(String id);

    //修改品牌的显示状态
    public int updateBrandStatusById(@Param("id") String id, @Param("status") Integer status);

    //通过品牌id删除品牌信息
    @Delete("delete from mall_goods_brand where id = #{id}")
    public int delBrandByBrandId(String id);

    //修改品牌信息
    public int updateBrandInfo(MallGoodsBrandEntity mallGoodsBrand);

    //批量删除
    public int delMore(Integer[] ids);

    //查询所有品牌
    @Select("select * from mall_goods_brand")
    public List<MallGoodsBrandEntity> findAllBrand();
}